<?php
/**
 * Class Index
 *
 * das ist eigentlich verhält sich wie login
 */
class Index extends Controller {

    function __construct() {
        parent::__construct();
        //echo 'We are in index';
        $this->view->msg = 'This for login';
        $this->loadModel('index');
    }

    function index(){
        
        $data = $this->model->getData();
        if (isset($data['loggedIn']) && $data['loggedIn']){
          $this->view->assign('loggedIn', true);
          $this->view->assign('userName', $data['userName']);
          $this->view->render('index/loginSuccess');

           
        }else{
          $this->view->render('index/index');
        }
        
    }


    public function getRunTimeJessiMsg(){
        $content =  "<h2>Hallo jessi, alles ist seit Juli, 2008 ...</h2>";
        $content .= '<div class="cacsTxt"><p>There are so many towns in the world,there are so many pubs in the town ,i goes in her.</p><p>(世上有那么多的城镇，城镇有那么多的酒馆，我却走进了她的。)</p></div>';
        //$content .= '<div class="cacsImage"> <img src="'.URL.'public/media/images/casa.jpg" alt="" /></div>';
        return $content;

    }

    public function getRunTimeJessiFooterMsg(){
        $size = Helper::getJessiVideoSize();
        $src = URL.'public/media/videos/jessi2.mp4';
        //return '<iframe width="'.$size['w'].'" height="'.$size['h'].'" src="http://www.youtube.com/embed/dOmv8Los3dA?rel=0&autoplay=1" frameborder="0" allowfullscreen></iframe>';
        return '<video width="420" height="320" controls="controls">
<source src="'.$src.'" type="video/mp4">
</video>';

        return '<video controls>
        <source src="HttpLiveStream.m3u8" type="vnd.apple.mpegURL">
        <source src="'.$src.'" type="video/mp4">
        <source src="OggVorbis.ogv" type="video/ogg">
        <!-- fallback -->
        <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
                codebase="http://www.apple.com/qtactivex/qtplugin.cab"
                height="420"
                width="320">
            <param name="src" value="'.$src.'">
        </object>
    </video>';
        /*return '<video controls>
         <source src="'.$src.'" type="video/quicktime">

       <!-- fallback -->
       <script type="text/javascript">
            QT_WriteOBJECT('.$src.' , "320", "240", "");
       </script>
      </video>';*/

        /*return '<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" WIDTH="221"

HEIGHT="118" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">

<PARAM name="SRC" VALUE="'.$src.'">

<PARAM name="AUTOPLAY" VALUE="true">

<PARAM name="CONTROLLER" VALUE="false">

<EMBED SRC="sample.mov" WIDTH="420" HEIGHT="320" AUTOPLAY="true"

CONTROLLER="false"

PLUGINSPAGE="http://www.apple.com/quicktime/download/">

</EMBED>

</OBJECT>
';*/
            //'<video width="420" height="320" controls="controls">
//<source src="'.$src.'" type="video/mp4">
//</video>';
        //return '<iframe width="420" height="315" src="http://www.youtube.com/embed/dOmv8Los3dA?rel=0&autoplay=1" frameborder="0" allowfullscreen></iframe>';
        //casa
        //return '<iframe width="1" height="1" src="http://www.youtube.com/embed/nimSGwmC3BU?rel=0&autoplay=1" frameborder="0" allowfullscreen></iframe>';
    }

}
?>